<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.lmpop.frame.util.PageTools"%>
<%@page import="com.lmpop.trade.ti_comm_give.Ti_comm_giveInfo"%>
<%

		Map params = new Hashtable();
		String iStart = "0";
		int counter = 0;
		List list = null;
		int limit = 3;
		String pageString = null;
		int listsize = 0;
		Hashtable nMap = new Hashtable();
		Ti_comm_giveInfo comm_giveInfo = new Ti_comm_giveInfo();
		String comm_cust_id = "", trade_state_code = "";
			
	request.setCharacterEncoding("UTF-8");

	if (request.getParameter("trade_state_code") != null) {
		trade_state_code = request.getParameter("trade_state_code");
		params.put("trade_state_code", trade_state_code);
	}
	if (request.getParameter("comm_cust_id") != null) {
		comm_cust_id = request.getParameter("comm_cust_id");
		params.put("comm_cust_id", comm_cust_id);
	}
	
	if (request.getParameter("iStart") != null)
		iStart = request.getParameter("iStart");

	counter = comm_giveInfo.getCountByObj(params);
	list = comm_giveInfo.getListByPage(params, Integer.parseInt(iStart), limit);

	pageString=new PageTools().getGoogleToolsBar(counter,
			"/8diantuan_member.html?classtype=yaoqing&trade_state_code="+trade_state_code+"&comm_cust_id="+comm_cust_id+"&iStart=", Integer.parseInt(iStart), limit);
%>

		<table class="tablelist">
							<thead>
								<tr>
									<th>
										邀请人
									</th>
									<th>
										邀请日期
									</th>
									<th>
										当前状态
									</th>
									<th>
										购买日期
									</th>
								</tr>
							</thead>


	<%
		if (null != list && list.size() > 0) {
			listsize = list.size();
			for (int i = 0; i < list.size(); i++) {
				nMap = (Hashtable) list.get(i);
				String user_name = "", state_date = "", state_code = "", comm_code = "", comm_url = "", in_date = "";
				if (nMap.get("user_name") != null)
					user_name = nMap.get("user_name").toString();
				if (nMap.get("in_date") != null) {
					in_date = nMap.get("in_date").toString();
					in_date = in_date.substring(0, 10);
				}
				if (nMap.get("state_date") != null){
					state_date = nMap.get("state_date").toString();
					state_date = state_date.substring(0, 10);
				}
				if (nMap.get("trade_state_code") != null)
					state_code = nMap.get("trade_state_code").toString();
				if (nMap.get("comm_code") != null)
					comm_code = nMap.get("comm_code").toString();
	%>
	<tr>
		<td >
			<%=user_name%>
		</td>
		<td >
			<%=in_date%>
		</td>
		<td >
			<%
				if (state_code!=null&&state_code.equals("1"))
					out.println("已返利");
				else
					out.println("未返利");	
			%>
		</td>
			<td >
			<%=state_date%>
		</td>
	</tr>

	<%
		}
		}
	%>
</table>
			<div style="float:right; margin-top:10px;"><%=pageString%></div>
